package com.ftg.learn.smhtml.service;


import com.ftg.learn.smhtml.mapper.AboutMapper;
import com.ftg.learn.smhtml.pojo.About;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Service
public class AboutService {

    @Autowired
    AboutMapper dd;

    public List<About> showAll(String id, int page, int limit){
        return dd.showAll(id,(page - 1) * limit,limit);
    }

    public List<About> findone(@PathVariable("id") String id) {
        return dd.findone(id);
    }

    public int update(About about) {
        return dd.update(about);
    }

    public int delete( @PathVariable("id") String id) {
        return dd.delete(id);
    }

    public int save(About about) {
        return dd.save(about);
    }

    public int getCount(String id) {
        return dd.getCount(id).size();
    }

}
